package com.lxb.myforum.controller

import com.lxb.myforum.base.BaseController
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestMapping


@Controller
@RequestMapping("/users")
class UserController : BaseController() {

    /**
     * 用户设置页面
     * @return
     */
    @GetMapping(value = ["/setting"])
    fun setting(): String {
        return "/users/setting"
    }

    /**
     * 用户个人首页
     * @return
     */
    @GetMapping(value = ["/{id}"])
    fun home(@PathVariable("id") id: Long): String {

        return "/users/home"
    }

    /**
     * 用户的文章
     * @return
     */
    @GetMapping(value = ["/users/{id}/articles"])
    fun articles(@PathVariable("id") id: Long): String {

        return "/users/_user_articles"
    }

    /**
     * 用户的帖子
     * @return
     */
    @GetMapping(value = ["/users/{id}/posts"])
    fun posts(@PathVariable("id") id: Long): String {

        return "/users/_user_posts"
    }

    /**
     * 用户的动态
     * @return
     */
    @GetMapping(value = ["/users/{id}/activities"])
    fun activities(@PathVariable("id") id: Long): String {

        return "/users/_user_activities"
    }
}
